#!/usr/bin/perl

use strict;

my ($wget, %file);
$wget = q{wget -c --load-cookies=cookies.txt --tries=1 --read-timeout=12};
@file{qw{

}} = undef;

my $cnt = keys %file;
while (1) {
    for my $cur (keys %file) {
        my $run = sprintf("%s %s", $wget, $cur);
        unless ( system($run) ) {
            $cnt--;
            delete $file{$cur};
        }
        sleep int rand 12;
    }
    
    exit unless $cnt;
}

